<template>
  <div class="app">
    <h3 ref="text">我是App组件</h3>
    <h4>{{msg}}</h4>
    <button @click="showH3Text">点我提示H3标签中的内容</button>
    <School ref="xuexiao" />
  </div>
</template>

<script>

  import School from './components/School'

  export default {
      name: 'App',
      components: {School},
      data(){
        return{
          msg: '欢迎学习Vue'
        }
      },
      methods: {
        showH3Text(){
          alert(this.$refs.text.innerText)
          console.log(this.$refs.xuexiao)
        }
      }
  }
</script>

<style>
  .app{
    background: #aaa;
    padding: 30px;
  }
</style>